home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Adobe Graphics & Publishing SDK 1996 December
/
Adobe Graphics & Publishing SDK 1996 December.iso
/
mac
/
Premiere 4.2 SDK r3 Mac
/
Examples
/
Projects
/
SuperMac
/
SuperMac.c
< prev
next >
Wrap
Text File
|
1996-01-25
|
4KB
|
122 lines
//========================================================================================
//
// SuperMac.c - Zoom module for SuperMac video cards.
//
// Written by Randy Ubillos and Bryan K. "Beaker" Ressler.
//
// Copyright ⌐ 1993-96, Adobe Systems Incorporated, all rights reserved worldwide.
//
// Version 1.00 10/20/93 Original version.
// Version 1.01 9/12/94 Updated for 4.0.
// Version 1.02 10/26/95 Updated for 4.2 and CW7.
//
//========================================================================================
//========================================================================================
// Includes - use precompiled headers if compiling with CodeWarrior.
//========================================================================================
#ifdef __MWERKS__
#ifdef powerc
#include "PremierePPC"
#else
#include "Premiere68k"
#endif
#else
#include "Premiere.h"
#endif
//========================================================================================
// Structure for the Status and Control calls
//========================================================================================
typedef struct {
QElem *qLink; // Queue link in header
short qType; // Type byte for safety check
short ioTrap; // FS: the Trap
Ptr ioCmdAddr; // FS: address to dispatch to
ProcPtr ioCompletion; // Completion routine addr (0 for synch calls)
OSErr ioResult; // Result code
StringPtr ioNamePtr; // Ptr to Vol:FileName string
short ioVRefNum; // Volume refnum (DrvNum for Eject and MountVol)
short ioCRefNum; // RefNum for I/O operation
short csCode; // Word for control status code
Ptr csParam; // Operation-defined parameters
long dummy[5]; // Extra
} boardParam;
//========================================================================================
// Codes that the SuperMac driver knows about
//========================================================================================
#define csZoomIn 0x0400
#define csZoomOut 0x0401
#define csVisibleRect 0x0403
#define csGetTopLeft 0x0404
#define csSetPanFlag 0x0405
#define csSetPanLoc 0x0406
//========================================================================================
// Process the commands
//========================================================================================
pascal short main (short selector, ZoomHand theData)
{
short result = 0;
boardParam block;
GDHandle theGD;
Point spot;
short zero = 0, one = 1;
// Cache up the GDevice in question
theGD = (*theData)->theDevice;
// Act according to the selector
switch (selector) {
case cmdCanDo:
case cmdCanZoom:
// Premiere is asking the ZooM module whether the card driving the specifed
// GDevice can perform hardware zoom. Result = false means the device CAN'T
// zoom, result = true means it CAN.
block.ioCRefNum = (*theGD)->gdRefNum;
block.csCode = csGetTopLeft;
if (!PBStatus((ParmBlkPtr)&block, false))
result = true;
break;
case cmdZoomIn:
// Premiere is telling the ZooM module to zoom in (make pixels bigger). So,
// we call the driver to zoom it in turn off panning, and set the pan loc-
// ation to 0, 0.
block.ioCRefNum = (*theGD)->gdRefNum;
block.csCode = csZoomIn;
PBControl((ParmBlkPtr)&block, false); // Zoom in
block.csCode = csSetPanFlag; // Disable panning
block.csParam = (Ptr)&zero;
PBControl((ParmBlkPtr)&block, false);
spot.h = 0;
spot.v = 0;
block.csCode = csSetPanLoc;
block.csParam = (Ptr)&spot;
PBControl((ParmBlkPtr)&block, false); // Move h/w to 0, 0
break;
case cmdZoomOut:
// Playback is complete, and Premiere is telling the ZooM module to zoom out
// (make pixels normal size again). So, we call the driver to re-enable pan-
// ning and zoom back out.
block.ioCRefNum = (*theGD)->gdRefNum;
block.csCode = csSetPanFlag; // Enable panning
block.csParam = (Ptr)&one;
PBControl((ParmBlkPtr)&block, false);
block.csCode = csZoomOut; // Zoom out
PBControl((ParmBlkPtr)&block, false);
break;
case cmdGetSupportedModes:
case cmdGetMode:
case cmdSetMode:
default:
break;
}
return(result);
}